3.3.23 \(\int \sin ^2(c+d x) (a+b \sin (c+d x))^n \, dx\) [223]

Optimal. Leaf size=274 \[ -\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}+\frac {\sqrt {2} a (a+b) F_1\left (\frac {1}{2};\frac {1}{2},-1-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n}}{b^2 d (2+n) \sqrt {1+\sin (c+d x)}}-\frac {\sqrt {2} \left (a^2+b^2 (1+n)\right ) F_1\left (\frac {1}{2};\frac {1}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n}}{b^2 d (2+n) \sqrt {1+\sin (c+d x)}} \]

[Out]

-cos(d*x+c)*(a+b*sin(d*x+c))^(1+n)/b/d/(2+n)+a*(a+b)*AppellF1(1/2,-1-n,1/2,3/2,b*(1-sin(d*x+c))/(a+b),1/2-1/2*
sin(d*x+c))*cos(d*x+c)*(a+b*sin(d*x+c))^n*2^(1/2)/b^2/d/(2+n)/(((a+b*sin(d*x+c))/(a+b))^n)/(1+sin(d*x+c))^(1/2
)-(a^2+b^2*(1+n))*AppellF1(1/2,-n,1/2,3/2,b*(1-sin(d*x+c))/(a+b),1/2-1/2*sin(d*x+c))*cos(d*x+c)*(a+b*sin(d*x+c
))^n*2^(1/2)/b^2/d/(2+n)/(((a+b*sin(d*x+c))/(a+b))^n)/(1+sin(d*x+c))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.20, antiderivative size = 274, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2870, 2835, 2744, 144, 143} \begin {gather*} -\frac {\sqrt {2} \left (a^2+b^2 (n+1)\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n} F_1\left (\frac {1}{2};\frac {1}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right )}{b^2 d (n+2) \sqrt {\sin (c+d x)+1}}+\frac {\sqrt {2} a (a+b) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n} F_1\left (\frac {1}{2};\frac {1}{2},-n-1;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right )}{b^2 d (n+2) \sqrt {\sin (c+d x)+1}}-\frac {\cos (c+d x) (a+b \sin (c+d x))^{n+1}}{b d (n+2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]^2*(a + b*Sin[c + d*x])^n,x]

[Out]

-((Cos[c + d*x]*(a + b*Sin[c + d*x])^(1 + n))/(b*d*(2 + n))) + (Sqrt[2]*a*(a + b)*AppellF1[1/2, 1/2, -1 - n, 3
/2, (1 - Sin[c + d*x])/2, (b*(1 - Sin[c + d*x]))/(a + b)]*Cos[c + d*x]*(a + b*Sin[c + d*x])^n)/(b^2*d*(2 + n)*
Sqrt[1 + Sin[c + d*x]]*((a + b*Sin[c + d*x])/(a + b))^n) - (Sqrt[2]*(a^2 + b^2*(1 + n))*AppellF1[1/2, 1/2, -n,
 3/2, (1 - Sin[c + d*x])/2, (b*(1 - Sin[c + d*x]))/(a + b)]*Cos[c + d*x]*(a + b*Sin[c + d*x])^n)/(b^2*d*(2 + n
)*Sqrt[1 + Sin[c + d*x]]*((a + b*Sin[c + d*x])/(a + b))^n)

Rule 143

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[((a + b*x)
^(m + 1)/(b*(m + 1)*(b/(b*c - a*d))^n*(b/(b*e - a*f))^p))*AppellF1[m + 1, -n, -p, m + 2, (-d)*((a + b*x)/(b*c
- a*d)), (-f)*((a + b*x)/(b*e - a*f))], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !Inte
gerQ[n] &&  !IntegerQ[p] && GtQ[b/(b*c - a*d), 0] && GtQ[b/(b*e - a*f), 0] &&  !(GtQ[d/(d*a - c*b), 0] && GtQ[
d/(d*e - c*f), 0] && SimplerQ[c + d*x, a + b*x]) &&  !(GtQ[f/(f*a - e*b), 0] && GtQ[f/(f*c - e*d), 0] && Simpl
erQ[e + f*x, a + b*x])

Rule 144

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[(e + f*x)^
FracPart[p]/((b/(b*e - a*f))^IntPart[p]*(b*((e + f*x)/(b*e - a*f)))^FracPart[p]), Int[(a + b*x)^m*(c + d*x)^n*
(b*(e/(b*e - a*f)) + b*f*(x/(b*e - a*f)))^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !IntegerQ[m]
&&  !IntegerQ[n] &&  !IntegerQ[p] && GtQ[b/(b*c - a*d), 0] &&  !GtQ[b/(b*e - a*f), 0]

Rule 2744

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[Cos[c + d*x]/(d*Sqrt[1 + Sin[c + d*x]]*Sqrt
[1 - Sin[c + d*x]]), Subst[Int[(a + b*x)^n/(Sqrt[1 + x]*Sqrt[1 - x]), x], x, Sin[c + d*x]], x] /; FreeQ[{a, b,
 c, d, n}, x] && NeQ[a^2 - b^2, 0] &&  !IntegerQ[2*n]

Rule 2835

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(b*
c - a*d)/b, Int[(a + b*Sin[e + f*x])^m, x], x] + Dist[d/b, Int[(a + b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{
a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]

Rule 2870

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(
-d^2)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f
*x])^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c
, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int \sin ^2(c+d x) (a+b \sin (c+d x))^n \, dx &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}+\frac {\int (b (1+n)-a \sin (c+d x)) (a+b \sin (c+d x))^n \, dx}{b (2+n)}\\ &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}-\frac {a \int (a+b \sin (c+d x))^{1+n} \, dx}{b^2 (2+n)}+\frac {\left (a^2+b^2 (1+n)\right ) \int (a+b \sin (c+d x))^n \, dx}{b^2 (2+n)}\\ &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}-\frac {(a \cos (c+d x)) \text {Subst}\left (\int \frac {(a+b x)^{1+n}}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (c+d x)\right )}{b^2 d (2+n) \sqrt {1-\sin (c+d x)} \sqrt {1+\sin (c+d x)}}+\frac {\left (\left (a^2+b^2 (1+n)\right ) \cos (c+d x)\right ) \text {Subst}\left (\int \frac {(a+b x)^n}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (c+d x)\right )}{b^2 d (2+n) \sqrt {1-\sin (c+d x)} \sqrt {1+\sin (c+d x)}}\\ &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}+\frac {\left (a (-a-b) \cos (c+d x) (a+b \sin (c+d x))^n \left (-\frac {a+b \sin (c+d x)}{-a-b}\right )^{-n}\right ) \text {Subst}\left (\int \frac {\left (-\frac {a}{-a-b}-\frac {b x}{-a-b}\right )^{1+n}}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (c+d x)\right )}{b^2 d (2+n) \sqrt {1-\sin (c+d x)} \sqrt {1+\sin (c+d x)}}+\frac {\left (\left (a^2+b^2 (1+n)\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (-\frac {a+b \sin (c+d x)}{-a-b}\right )^{-n}\right ) \text {Subst}\left (\int \frac {\left (-\frac {a}{-a-b}-\frac {b x}{-a-b}\right )^n}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (c+d x)\right )}{b^2 d (2+n) \sqrt {1-\sin (c+d x)} \sqrt {1+\sin (c+d x)}}\\ &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^{1+n}}{b d (2+n)}+\frac {\sqrt {2} a (a+b) F_1\left (\frac {1}{2};\frac {1}{2},-1-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n}}{b^2 d (2+n) \sqrt {1+\sin (c+d x)}}-\frac {\sqrt {2} \left (a^2+b^2 (1+n)\right ) F_1\left (\frac {1}{2};\frac {1}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x)),\frac {b (1-\sin (c+d x))}{a+b}\right ) \cos (c+d x) (a+b \sin (c+d x))^n \left (\frac {a+b \sin (c+d x)}{a+b}\right )^{-n}}{b^2 d (2+n) \sqrt {1+\sin (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 3.33, size = 0, normalized size = 0.00 \begin {gather*} \int \sin ^2(c+d x) (a+b \sin (c+d x))^n \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[Sin[c + d*x]^2*(a + b*Sin[c + d*x])^n,x]

[Out]

Integrate[Sin[c + d*x]^2*(a + b*Sin[c + d*x])^n, x]

________________________________________________________________________________________

Maple [F]
time = 0.37, size = 0, normalized size = 0.00 \[\int \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +b \sin \left (d x +c \right )\right )^{n}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)^2*(a+b*sin(d*x+c))^n,x)

[Out]

int(sin(d*x+c)^2*(a+b*sin(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*sin(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((b*sin(d*x + c) + a)^n*sin(d*x + c)^2, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*sin(d*x+c))^n,x, algorithm="fricas")

[Out]

integral(-(cos(d*x + c)^2 - 1)*(b*sin(d*x + c) + a)^n, x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)**2*(a+b*sin(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*sin(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((b*sin(d*x + c) + a)^n*sin(d*x + c)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\sin \left (c+d\,x\right )}^2\,{\left (a+b\,\sin \left (c+d\,x\right )\right )}^n \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)^2*(a + b*sin(c + d*x))^n,x)

[Out]

int(sin(c + d*x)^2*(a + b*sin(c + d*x))^n, x)

________________________________________________________________________________________